#pragma once
#include <xstring>
#define DUMP_EVENT _T("_leak_dump_")
#define CLEAR_LEAKS _T("_clr_all_leaks_")
#define SHOW_PDB_INFO _T("_show_pdb_load_info_" )
#define DEFAULT_PIPE_NAME  _T("\\\\.\\pipe\\_default_pipe_name_")
#define INJECT_EVENT_PARAM _T("_inject_event_param_")
#define READ_COMPLETE_EVENT _T("_read_complete_event_")
#define DUMP_EVENT_CMD _T("_leak_dump_cmd_")

#define LEAKMON_PROMPT  _T("prompt:")
#define LEAKMON_WARN    _T("warn:")
#define LEAKMON_ERROR   _T("error:")
#define LEAKMON_PRINTF(level,str)      printf("%s%s",(level),(str));
#ifndef AfxMessageBox          //close AfxMessageBox
#define AfxMessageBox(x)
#endif
inline void getValue(std::string const& str, std::string const & key ,std::string &des)
{
	size_t posStart = 0;
	size_t posEnd = str.size();
	posStart = str.find(key);
	size_t len = key.length();
	if (posStart != std::string::npos)
	{
		posEnd = str.find(" ", posStart);
		if (posEnd != std::string::npos)
		{
			des = str.substr(posStart+len, posEnd-posStart -len);
		}
		else
		{
			des = str.substr(posStart+len);
		}
	}

}
